package com.youoor.common.base;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public abstract class BaseDaoImpl<E,EQ,PK> implements BaseDao<E,EQ,PK> {
	private static final Logger logger = LoggerFactory.getLogger(BaseDaoImpl.class);
	public abstract BaseMapper<E,EQ,PK> getBaseMapper();

	@Override
	public int save(E record) {
		return getBaseMapper().insert(record);
	}

	@Override
	public int saveSelective(E record) {
		return getBaseMapper().insertSelective(record);
	}

	@Override
	public int countByExample(EQ example) {
		return getBaseMapper().countByExample(example);
	}

	@Override
	public int deleteByExample(EQ example) {
		return getBaseMapper().deleteByExample(example);
	}

	@Override
	public int deleteByPrimaryKey(PK id) {
		return getBaseMapper().deleteByPrimaryKey(id);
	}

	@Override
	public List<E> selectByExample(EQ example,Integer num) {
		return getBaseMapper().selectByExample(example,num);
	}
	
	@Override
	public List<E> selectByExamplePage(EQ example,Integer pageIndex,Integer num) {
		return getBaseMapper().selectByExamplePage(example,pageIndex,num);
	}

	@Override
	public E selectByPrimaryKey(PK id) {
		return getBaseMapper().selectByPrimaryKey(id);
	}

	@Override
	public int updateByExampleSelective(E record, EQ example) {
		return getBaseMapper().updateByExampleSelective(record, example);
	}

	@Override
	public int updateByExample(E record, EQ example) {
		return getBaseMapper().updateByExample(record, example);
	}

	@Override
	public int updateByPrimaryKeySelective(E record) {
		return getBaseMapper().updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(E record) {
		return getBaseMapper().updateByPrimaryKey(record);
	}

	

}
